﻿<?php
	$id=$_GET["id"];
	$makt=$_GET["code"];
	if(isset($id) && isset($makt))
	{

		//khoi dong su kien
		session_start();
		//kiem tra quyen admin
		include("kiemtraquyen.php");
		//kết nối với csdl
		include("connect.php");
		$sql="insert into kt_cau_hoi values($makt,$id)";
		mysql_query($sql);
		header("location:themcauhoivaokt.php?id=$makt");
		echo"themthanhcong";
	}

	elseif(isset($makt) && !isset($id))
	{
		header("location:themcauhoivaokt.php?id=$makt");
	}
	else
	{
		header("location:suakt.php");
	}

?>